"use strict"
/// <reference path="../../index.d.ts" />
const Service = require("egg").Service
class UserApiService extends Service {
	constructor(ctx) {
		super(ctx)
		this.wechatpi = this.ctx.wechatAccount
	}
	async   getUser(openid) {
		return await this.wechatpi.getUser(openid)
	}

	async   batchGetUsers(arr) {
		return await this.wechatpi.batchGetUsers(arr)
	}
	async   getFollowers(nextOpenid) {
		if (arguments.length == 1) {
			return await this.wechatpi.getFollowers(nextOpenid)
		}
		else {
			return await this.wechatpi.getFollowers()
		}
	}
	/**
	 * @param {{openid:string,remark:string}} obj 
	 * @returns 
	 */
	async updateRemark(obj) {
		return await this.wechatpi.updateRemark(obj.openid, obj.remark)
	}

}
module.exports = UserApiService